

import numpy as np

arr = [3, 1, 4, 2]
sorted_indices = np.argsort(arr)[::-1]
print(sorted_indices)
# sorted_arr = [arr[i] for i in sorted_indices]
#
# print(sorted_arr)  # Output: [4, 3, 2, 1]
